<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title><?php echo $title;?></title>
    <!-- 设置缩放 -->
    <meta name="viewport" content="minimal-ui,width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <!-- IOS中禁用将数字识别为电话号码/忽略Android平台中对邮箱地址的识别 -->
    <meta name="format-detection" content="telephone=no" />
    <!-- windows phone 点击无高光 -->
    <meta name="msapplication-tap-highlight" content="no" />
    <!-- icon -->
    <link rel="shortcut icon" href="<?php echo ADMIN_ICO_PIC;?>" type="image/x-icon" />
    <!-- css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SYS_LINK;?>admin/css/content.css?v=<?php echo V_CSSJS;?>" />
    <style>
        *{margin:0;padding:0;border:0;outline:0;}
        body{min-width:1050px;font-size:14px;}
        .count-box{overflow:hidden;}
        .count-box a span,#jsNowDateTime{color:#fff;}
        .count-read,.count-visit,.count-ip,.count-date,.count-weather{float:left;display:inline-block;width:15%;min-width:150px;height:60px;margin:20px 0 20px 2%;text-align:center;color:#fff;font-size:18px;padding-top:8px;border-radius: 6px;}
        .count-box .count-read{background:#bc79f5;}
        .count-box .count-visit{background:#2ED8B6;}
        .count-box .count-ip{background:#05d4ef;}
        .count-box .count-ip #ipNo{font-size: 14px;}
        .count-box .count-date{background:#ff8f00;width:20%;min-width:195px;font-size:14px;}
        .count-box .count-weather{background:#73d008;width:23%;min-width:250px;}
        .count-weather div{padding:0px 20px;}
        .count-date div,.count-ip div{padding:2px 0px;}
        .count-box font{font-size:14px;}
        .count-box div{padding:2px 0px;}
        .table_box{margin:0px 2% 20px 2%;border:2px solid #6aeafb;}
        .title_box{padding:5px 10px;/*border:1px solid #ebf6ff;background: #ebf6ff;*/font-size:18px;text-align: center;color:#00bcd4;}
        .count-table{height:309px;overflow:hidden;overflow-y:scroll;overflow-x:auto;}
        .table_th{overflow:hidden;overflow-y:scroll;}
        .com-table{width:100%; table-layout:fixed;}
        .com-table td,.com-table th{white-space:nowrap;border:1px solid #ccc;border-top:none;border-left:none;overflow:hidden;max-width:260px;height:20px;}
        .com-table th{border-top:1px solid #ccc;}
        .com-table th:first-child,.com-table td:first-child{border-left:0px solid #999;}
        .com-table tr:first-child th {border-top:none;}
        .com-table td,.com-table th{padding:5px 10px;text-align:center;font-size:12px;font-weight:400;}
        .com-table td a{color:#00bcd4;}
        .com-table td a:hover{color: #14cf90;}
        .com-table td.tdleft{text-align:left;}
        .com-table td.tdleft a{display:block;width:100%;overflow:hidden; white-space:nowrap;text-overflow:ellipsis; }
        .com-table tr:hover td{background:#eee;}
        .count-search{padding:5px 10px 5px 40px;line-height:30px;border: 1px solid #ccc;border-left:none;border-right:none;}
        .input100{border:1px solid #ccc;width:100px;padding:0px 10px;}
        .search-btn{background:#00BCD4;color:#fff;margin-right:20px;}
        .now-list span{color:red;margin-right:20px;}
        .count-infos .count-search input{padding:5px 10px;}
    </style>
    <script>
    </script>
</head>
<body class="noselect errMdList">
<!-- top_box (-->
<div class="count-box">
    <a class="count-read">
        <font>您的登录次数</font><br>
        <div>
            <span id="readNo"><?php echo $userLoginInfo['total_count'];?></span>
        </div>

    </a>
    <a class="count-visit">
        <font>当前IP地址</font><br>
        <div>
            <span id="visitNo"><?php echo $userLoginInfo['now_ip'];?></span>
        </div>
    </a>
    <a class="count-ip">
        <font>本次登录时间</font><br>
        <div>
            <span id="ipNo"><?php echo $userLoginInfo['last_time'];?></span>
        </div>
    </a>
    <a class="count-date">
        <font>当前日期时间</font><br>
        <div>
            <div id="jsNowDateTime"></div>
        </div>
    </a>
    <a class="count-weather">
        <font>天气预报</font><br>
        <div>
            <!--id:1,11,15,24,26,29,30,33,34,41,5,16,18,-->
            <iframe name="weather_inc" src="//i.tianqi.com/index.php?c=code&id=24&color=%23FFFFFF"
                    width="260" height="20" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" ></iframe>
        </div>
    </a>
</div>
<!-- top_box )-->

<!-- table_box (-->
<div class="count-infos">
    <!-- table1_box (-->
    <div class="table_box">
        <div class="title_box">系统登录日志</div>
        <div class="count-search">
            起止时间：<input type="text" id="startDate3" class="input100" placeholder="请点击选择日期" />&nbsp;~
            <input type="text" id="endDate3" class="input100" placeholder="请点击选择日期" />&nbsp;
            <input type="button" value="查询" class="search-btn" id="search-btn3">
        </div>
        <div class="table_th">
            <table cellpadding="0" cellspacing="0" border="0" class="com-table">
                <thead>
                <tr>
                    <th width="50">编号</th>
                    <th width="50">帐号ID</th>
                    <th>帐号名称</th>
                    <th>手机号</th>
                    <th>邮箱</th>
                    <th>登录IP</th>
                    <th>登录时间</th>
                </tr>
                </thead>
            </table>
        </div>
        <div class="count-table">
            <table cellpadding="0" cellspacing="0" border="0" class="com-table">
                <tbody id="loginList">

                </tbody>
            </table>
        </div>
    </div>
    <!-- table1_box )-->

    <!-- table2_box (-->
    <div class="table_box">
        <div class="title_box">系统操作日志</div>
        <div class="count-search">
            起止时间：<input type="text" id="startDate4" class="input100" placeholder="请点击选择日期" />&nbsp;~
            <input type="text" id="endDate4" class="input100" placeholder="请点击选择日期" />&nbsp;
            <input type="button" value="查询" class="search-btn" id="search-btn4">
        </div>
        <div class="table_th">
            <table cellpadding="0" cellspacing="0" border="0" class="com-table">
                <thead>
                <tr>
                    <th width="50">编号</th>
                    <th width="50">帐号ID</th>
                    <th width="100">帐号</th>
                    <th width="100">操作类型</th>
                    <th width="50">菜单ID</th>
                    <th width="200">操作菜单</th>
                    <th width="50">文章ID</th>
                    <th>文章标题</th>
                    <th width="150">操作时间</th>
                </tr>
                </thead>
            </table>
        </div>
        <div class="count-table">
            <table cellpadding="0" cellspacing="0" border="0" class="com-table">
                <tbody id="operateList">

                </tbody>
            </table>
        </div>
    </div>
    <!-- table2_box )-->
    <br><br>
</div>
<!-- table_box )-->
</body>
<script language="javascript">
    var http_url = '<?php echo SYS_HOST;?>';
    var http_link = '<?php echo SYS_LINK;?>';
    var cssjsv = '<?php echo V_CSSJS;?>';
    var http_fix = '<?php echo SYS_URL_FIX;?>';
</script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/jquery.min.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>plug/jedate/jedate.min.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>plug/layer3.1.1/layer.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/skin.js?v=<?php echo V_CSSJS;?>"></script>

<script type="text/javascript">

    /**
     * 动态时间
     */
    function check(i){
        if(i<10){
            i="0"+i;
        }
        return i;
    }
    function check2(z){
        var z=z+1900;
        return z;
    }
    function check1(l){
        var l=l+1;
        return l;
    }
    function check3(q){
        if(q == 0){
            q = '日';
        }else if(q == 1){
            q = '一';
        }else if(q == 2){
            q = '二';
        }else if(q == 3){
            q = '三';
        }else if(q == 4){
            q = '四';
        }else if(q == 5){
            q = '五';
        }else if(q == 6){
            q = '六';
        }
        return q;
    }
    function starttime(jsNowDateTime){
        var d = new Date();
        var y = d.getYear();
        var e = d.getMonth();
        var r = d.getDate();
        var q = d.getDay();
        var h = d.getHours();
        var m = d.getMinutes();
        var s = d.getSeconds();
        y = check2(y);
        e = check1(e);
        h = check(h);
        m = check(m);
        s = check(s);
        q = check3(q);
        var datetimestr = y+"年"+e+"月"+r+"日&nbsp;"+h+":"+m+":"+s+"（"+q+"）";
        document.getElementById(jsNowDateTime).innerHTML = datetimestr;
    }
    //动态日期时间控件
    setInterval("starttime('jsNowDateTime')",1000);

    //////////////////////////////////////////////////////////////////////////////////////

    // 登录日志url
    var url_log_login = "<?php echo SYS_URL_PATH('admin_index_loginlog')?>";
    // 操作日志url
    var url_log_operate = "<?php echo SYS_URL_PATH('admin_index_operatelog')?>";
    //当前日期
    var nowDates = "<?php echo date('Y-m-d');?>";

    /**
     * 日期控件初始日期
     */
    var minDate = "2022-01-01";
    jeDate({
        dateCell:'#startDate3',
        isTime:false,
        format:'YYYY-MM-DD',
        minDate:minDate,
        maxDate:nowDates
    })
    jeDate({
        dateCell:'#endDate3',
        isTime:false,
        format:'YYYY-MM-DD',
        minDate:minDate,
        maxDate:nowDates
    })
    jeDate({
        dateCell:'#startDate4',
        isTime:false,
        format:'YYYY-MM-DD',
        minDate:minDate,
        maxDate:nowDates
    })
    jeDate({
        dateCell:'#endDate4',
        isTime:false,
        format:'YYYY-MM-DD',
        minDate:minDate,
        maxDate:nowDates
    })

    /**
     * 当前检索搜索框日期
     */
    $('#startDate3').val(nowDates);
    $('#endDate3').val(nowDates);
    $('#startDate4').val(nowDates);
    $('#endDate4').val(nowDates);

    /**
     * 表格数据初始值
     */
    getLgoinList(nowDates, nowDates);
    getOperateList(nowDates, nowDates);

    /**
     * 表格数据查询
     */
    $('#search-btn3').on('click',function(){
        var startDate = $('#startDate3').val();
        var endDate = $('#endDate3').val();
        getLgoinList(startDate, endDate);
    })

    /**
     * 表格-页面访问详情
     */
    function getLgoinList(startDate, endDate){
        $.post(url_log_login, {startDate:startDate, endDate:endDate}, function(data){
            //console.log(data);
            if(data.code==10000){
                var html = '';
                var sumno = parseInt(data.data.sumno);
                for(var i in data.data.list){
                    var info = data.data.list[i];
                    html +='<tr><td width="50">'+sumno+'</td>';
                    html +='<td width="50">'+info.user_id+'</td>';
                    html +='<td>'+info.title+'</td>';
                    html +='<td>'+info.user_mobile+'</td>';
                    html +='<td>'+info.user_email+'</td>';
                    html +='<td>'+info.ip+'</td>';
                    html +='<td>'+info.createdate+'</td></tr>';
                    sumno --;
                }
                $('#loginList').html(html);
            }else{
                console.log(data);
                console.log('页面访问详情-fail：'+data.msg);
            }
        },'json').error(function(){
            console.log('页面访问详情-error');
        });
    }

    /**
     * 表格数据查询 2
     */
    $('#search-btn4').on('click',function(){
        var startDate = $('#startDate4').val();
        var endDate = $('#endDate4').val();
        getOperateList(startDate, endDate);
    })

    /**
     * 表格-系统登录日志
     */
    function getOperateList(startDate, endDate){
        $.post(url_log_operate, {startDate:startDate, endDate:endDate}, function(data){
            //console.log(data);
            if(data.code==10000){
                var html = '';
                var sumno = parseInt(data.data.sumno);
                for(var i in data.data.list){
                    var info = data.data.list[i];
                    html +='<tr><td width="50">'+sumno+'</td>';
                    html +='<td width="50">'+info.user_id+'</td>';
                    html +='<td width="100">'+info.title+'</td>';
                    html +='<td width="100">'+info.types+'</td>';
                    html +='<td width="50">'+info.menu_id+'</td>';
                    html +='<td width="200">'+info.menu_name+'</td>';
                    html +='<td width="50">'+info.essay_id+'</td>';
                    html +='<td class="tdleft" title="'+info.content+'">'+info.content+'</td>';
                    html +='<td width="150">'+info.createdate+'</td>';
                    html +='</tr>';
                    sumno --;
                }
                $('#operateList').html(html);
            }else{
                console.log(data);
                console.log('页面访问详情-fail:'+data.msg);
            }
        },'json').error(function(){
            console.log('页面访问详情-error:');
        });
    }

    window.onload = function () {


    }

</script>
</html>